
#include <signal.h>
#include <unistd.h>
#include <pthread.h>

#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/opt.h"
#include "libavutil/pixdesc.h"
#include "libavdevice/avdevice.h"

#include "dmai_env.h"
#include "av_capture.h"
#include "av_encode.h"
#include "av_streamer.h"

extern AVCodec h264_encoder;
extern AVCodec mpeg4_encoder;

void
ti_codec_init(void)
{
	avcodec_register(&h264_encoder);
	avcodec_register(&mpeg4_encoder);
}

void
sys_signal(int sig)
{
}

int main(int argc, char *argv[])
{
	signal(SIGPIPE, sys_signal);

	av_register_all();
	avdevice_register_all();
	ti_codec_init();

	av_log_set_level(AV_LOG_DEBUG);
	dmai_env_init();

	av_capture_init();
	av_encode_init();
	av_streamer_init();

	while (1)
		sleep (10);

	dmai_env_destroy();
	return 0;
}
